import {createRouter, createWebHashHistory, RouteRecordRaw} from 'vue-router'
import Home from '../components/Home.vue'

const routes: Array<RouteRecordRaw> = [
  {
    path: '/',
    name: 'Home',
    component: Home,
    redirect: '/add',
    children: [
      {
        path: '/add',
        name: 'Add',
        component: () => import('../views/Add.vue')
      },
      {
        path: '/done',
        name: 'Done',
        component: () => import('../views/Done.vue')
      }, {
        path: '/delete',
        name: 'Delete',
        component: () => import('../views/Delete.vue')
      },
      {
        path: '/all',
        name: 'All',
        component: () => import('../views/All.vue')
      },
    ]
  }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export default router
